﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="J_Film.ascx.cs" Inherits="Pub_Module_J_Film" %>
<script language="javascript" type="text/javascript" src="<%= ResolveClientUrl("~/")%>Pub/Js/JQ/jquery.tooltip.v.1.1.js"></script>
<style>
    #simpleTooltip
    {
        border: 1px solid red;
        background: #f7f5d1;
        padding: 2px 5px;
        color: #333;
        display: none;
    }
</style>
<script language="javascript" type="text/javascript">
    var Url = '<%= ResolveClientUrl("~/")%>';

    $(document).ready(function () {
        $('#idAddBasketFilm').live('click', function () {
            $obj = $(this);
            objCheck = $obj.find("img");
            if (objCheck.attr("check") == "no") {
                fnAddBasketFilm(objCheck, $obj);
            }
            else {
                CancelBasketFilm($obj);
            }

        });


        function CancelBasketFilm($obj) {
            objCheck = $obj.find("img");
            fnCancelBasketFilm(objCheck, $obj);

        }






        /*************************** ToolTip ****************************/
        //                         xOffset = 10;
        //		                 yOffset = 20;	

        var showPopupPD;
        $("li.liHoverProPDFilm").hover(function (e) {
            try {
                showPopupPD.abort();
            } catch (e) { }

            PDID = $(this).attr("PDID");
            CatID = $(this).attr("CatID");
            KindNo = $(this).attr("KindNo");

            var objtool = $(this);
            var tipX = e.pageX + 12;
            var tipY = e.pageY + 12;
            $("body").append("<div id='simpleTooltip' style='position: absolute; z-index: 100;'><font style='font-size:11px'>Loading...</font></div>");

            showPopupPD = $.ajax({
                type: "GET",
                url: Url + "Pub/Ajax/AjaxQuery.aspx?type=TooltipPropertiesPD&KindNo=" + KindNo + "&CatID=" + CatID + "&PDID=" + PDID,
                success: function (resp) {
                    if (resp != "") {
                        $("#simpleTooltip").html(resp);
                        /*if($.browser.msie) var tipWidth = $("#simpleTooltip").outerWidth(true)
                        else var tipWidth = $("#simpleTooltip").width()
                        $("#simpleTooltip").width(tipWidth);*/
                        // $("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium");        

                    }
                    else {
                        $("#simpleTooltip").remove();
                    }

                }
            });

        },
	                    function () {
	                        $("#simpleTooltip").remove();
	                    });
        $('#simpleTooltip').live('mouseout', function () {

            $("#simpleTooltip").remove();
        });
        $("li.liHoverProPDFilm").mousemove(function (e) {
            var tipX = e.pageX + 12;
            var tipY = e.pageY + 12;
            var tipWidth = $("#simpleTooltip").outerWidth(true);
            var tipHeight = $("#simpleTooltip").outerHeight(true);
            if (tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth;
            if ($(window).height() + $(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight;
            $("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium");

        });

    });    
</script>
<asp:Panel ID="TooltipPD" runat="server" CssClass="tooltipHover" Style="text-align: left;
    padding: 10px; display: none" Visible="false">
</asp:Panel>
<asp:Panel ID="divLoading" CssClass="div-loadingAbs" runat="server">
</asp:Panel>
<div style="background-color: #fffbff; padding: 5px; text-align: center; margin: 0px auto"
    class="div_skin-tango1">
    <div class="coverlblTitleProduct">
        <asp:Label CssClass="lbl_Normal1" ID="lblEmpty" runat="server" Text="Hiện tại sản phẩm chưa được cập nhật. Vui lòng quay lại sau..."
            Visible="false" ForeColor="white"></asp:Label>
        <asp:Label ID="lblTitleProduct" runat="server" Text="" CssClass="lblTitleProduct"></asp:Label>
        <div style="float: right; padding-right: 10px">
            <asp:HyperLink runat="server" ID="SearchFilm" Text="Tìm kiếm" NavigateUrl="~/Shopping/Stall/SearchFilm.aspx"></asp:HyperLink>
        </div>
    </div>
    <asp:DataList ID="dtlThumbnail" runat="server" RepeatDirection="Horizontal" CssClass="GridCoverCart"
        DataKeyField="FilmID" CellPadding="0" CellSpacing="0" OnItemDataBound="dtlThumbnail_ItemDataBound"
        RepeatColumns="4" OnItemCommand="dtlThumbnail_ItemCommand1">
        <ItemStyle Wrap="False" />
        <ItemTemplate>
            <asp:Panel ID="divCoverCart" runat="server" CssClass="CoverCart" Style="width: 178px;
                height: 310px; text-align: center">
                <ul class="fixUlBlock" style="text-align: center">
                    <li class="liHoverProPDFilm" pdid='<%# Eval("FilmID") %>' catid='<%# Eval("CatID") %>'
                        kindno='F'>
                        <div class="divBlock" style="width: 100%; text-align: center">
                            <ul class="fixUlBlock" style="width: 100%">
                                <li style="text-align: center; width: 100%">
                                    <asp:Image ID="imgHot" runat="server" Style="visibility: hidden" /><br />
                                    <asp:Literal ID="ltlImages" runat="server"></asp:Literal>
                                </li>
                                <li style="text-align: center">
                                    <asp:Label ID="lblTenSP" runat="server" CssClass="lbl_TitleProduct" Style="text-decoration: none"
                                        Text='<%# Eval("FilmEng") %>' Width="160px"></asp:Label><br />
                                    <asp:Label ID="lblTenVN" Style="padding-top: 3px" runat="server" CssClass="lbl_TitleProduct_VN"
                                        Text='<%# Eval("FilmVnd") %>' Width="160px"></asp:Label>
                                </li>
                                <li style="width: 100%; padding-top: 3px">
                                    <div style="width: 50%; float: left; text-align: left" class="lbl_ElementFilm">
                                        <%# Eval("Format") %>
                                    </div>
                                    <div style="width: 50%; float: left; text-align: right" class="lbl_ElementFilm">
                                        Năm:
                                        <%# Eval("FilmYear") %>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li>&nbsp;<asp:Panel ID="pnlFilm" runat="server" Width="100%" CssClass="divBlock"
                        Style="text-align: left" Visible="false">
                        <ul class="fixUlBlock">
                            <li>
                                <asp:Label ID="Label2" runat="server" CssClass="lbl_TitlePrice" Text="Dung lượng: "></asp:Label>
                                <asp:Label ID="Label5" runat="server" CssClass="lbl_Properties" Text='<%# Eval("Capacity")  %>'></asp:Label>
                            </li>
                        </ul>
                    </asp:Panel>
                    </li>
                </ul>
            </asp:Panel>
        </ItemTemplate>
    </asp:DataList>
    <asp:Panel ID="pnControl" runat="server" HorizontalAlign="Center" Width="100%">
        <div width="100%" align="center">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="2" align="center">
                        <asp:Label ID="Label7" runat="server" Text="Hiển thị "></asp:Label>
                        <asp:TextBox ID="txtPageSize" runat="server" CssClass="txt_Common" Height="13px"
                            Width="25px" MaxLength="3"></asp:TextBox>
                        <asp:Label ID="Label8" runat="server" Text="mẩu tin trên <b>1</b> trang"></asp:Label>&nbsp;<asp:Button
                            ID="btnGo" runat="server" CssClass="btn_Common" Height="21px" OnClick="Button1_Click"
                            Text="Go" Width="33px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblDisplay" runat="server"></asp:Label>
                        <asp:Label ID="lblrecordcount" runat="server" Visible="False"></asp:Label>
                        <asp:Label ID="lblindex" runat="server" Visible="False">0</asp:Label>
                        <asp:Label ID="lblpageSize" runat="server" Visible="False">10</asp:Label>
                    </td>
                    <td>
                        <asp:ImageButton ID="btnIFirst" runat="server" ImageUrl="~/Images/Icon/FirstPage.png"
                            OnClick="btnIFirst_Click" /><asp:ImageButton ID="btnIPre" runat="server" ImageUrl="~/Images/Icon/PrevPage.png"
                                OnClick="btnIPre_Click" /><asp:ImageButton ID="btnINext" runat="server" ImageUrl="~/Images/Icon/NextPage.png"
                                    OnClick="btnINext_Click" /><asp:ImageButton ID="btnILast" runat="server" ImageUrl="~/Images/Icon/LastPage.png"
                                        OnClick="btnILast_Click" />
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
</div>
